package com.coco.group;

import com.coco.common.util.IdWorker;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

/**
 * @author minicoco
 * @version 1.0
 * @date 2021/7/29 19:05
 */
@SpringBootApplication(scanBasePackages = "com.coco")
@EnableDiscoveryClient
@EnableFeignClients
public class CocoGroupBuyApplication {

    public static void main(String[] args) {
        SpringApplication.run(CocoGroupBuyApplication.class,args);
    }

    /**
     * 注入雪花算法
     */
    @Bean
    public IdWorker idWorker(){
        return new IdWorker();
    }

//    /**
//     * 注入redisson
//     * @return Redisson
//     */
//    @Bean
//    public Redisson redisson(){
//        Config config = new Config();
//        config.useSingleServer().setAddress("redis://127.0.0.1:6379");
//        return (Redisson) Redisson.create(config);
//    }

}
